import {
	Routes,
	Route,
	unstable_HistoryRouter as HistoryRouter,
} from 'react-router-dom'
import { history } from '@/utils'
import Layout from '@/pages/Layout'
import Login from '@/pages/Login'
import AuthRoute from '@/components/AuthRoute'
import './App.scss'
import Home from './pages/Home'
import Article from './pages/Article'
import Publish from './pages/Publish'
function App() {
	return (
		<HistoryRouter history={history}>
			<div className="App">
				<Routes>
					<Route
						path="/"
						element={
							<AuthRoute>
								<Layout />
							</AuthRoute>
						}
					>
						<Route index element={<Home />} />
						<Route path="article" element={<Article />} />
						<Route path="publish" element={<Publish />} />
					</Route>
					<Route path="/login" element={<Login />}></Route>
				</Routes>
			</div>
		</HistoryRouter>
	)
}

export default App
